#include "Threadpool.hpp"
#include<iostream>
#include "Task.hpp"
#include<string>
#include <memory>
#include<unistd.h>

using namespace std;


int main()
{
    unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>);
    tp->init();
    tp->start();
    tp->check();
    usleep(1000);

    while(1)
    {
        int x,y;
        char op;
        cout<<"please Enter x> ";
        cin>>x;
        cout<<"please Enter y> ";
        cin>>y;
        cout<<"please Enter op(+-*/%)> ";
        cin>>op;

        Task t(x,y,op);
        tp->pushTask(t);
        sleep(1);
    }

    return 0;
}